package com.ruoyi.web.admin.data;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author 10100
 * @license (C) Copyright 2020-2050,  Corporation Limited.
 * @contact wang.he@cpe-smartcity.com
 * @date 2025-06-10 11:11
 * @description netty启动类
 */
@Component
public class NettyRunner implements CommandLineRunner {


    @Value("${tcp.port:9000}")
    private int port;

    private final NettyServer nettyServer;

    public NettyRunner(NettyServer nettyServer) {
        this.nettyServer = nettyServer;
    }

    @Override
    public void run(String... args) {
        this.nettyServer.start(this.port);
    }
}
